import java.util.Scanner;
public class demo01{
    public static void main(String[] args) {
        int radius = 10;
        final double PI = 3.14159;  //定义周长
        double perimeter;//周长
        double area = PI * radius * radius;
        perimeter = 2 * PI * radius;
        System.out.println("The area of a circle with radius " + radius +
                " is " + area);
        System.out.println("半径为 " + radius + " 的圆的周长为：" + perimeter);
        System.out.println("-------------");
        //将半径值设为20
        radius = 20;
        area = PI * radius * radius;
        System.out.println("The area of a circle with radius " + radius +
                " is " + area);
        System.out.println("半径为 " + radius + " 的圆的周长为：" + perimeter);
        System.out.println("-------------");
        //定义原始半径值
        radius = 20;
        //定义新周长、面积
        double perimeter_1, area_1;
        perimeter_1 = PI * radius * radius;
        area_1 = PI * radius * radius;
        System.out.println("The area of a circle with radius " + radius +
                " is " + area_1);//面积
        System.out.println("半径为 " + radius + " 的圆的周长为：" + perimeter_1);
        //半径增大一倍
        radius = 40;
        perimeter_1 = PI * radius * radius;
        area_1 = PI * radius * radius;
        System.out.println("The area of a circle with radius " + radius + " is " + area_1);//面积
        System.out.println("半径为 " + radius + " 的圆的周长为：" + perimeter_1);
        System.out.println("-----------");
        System.out.println("半径前后变化的周长之间的比值： " + (perimeter/perimeter_1));
        System.out.println("半径前后变化的面积之间的比值： " + (area/area_1));
        System.out.println("----------");
        //灵活改良版
        Scanner scan = new Scanner(System.in);
        System.out.println("Please enter a value for the radius！");
        int radius_2 = scan.nextInt();//你就说能不能用吧
        System.out.println("输入的半径为：" + radius_2);

    }
}

